#include <linux/init.h>
#include <linux/thread_info.h>
#include <linux/hardirq.h>
#include <linux/sched.h>

#include <arm/v7m.h>
#include <asm/io.h>

__weak void __hal_SysTick_Handler(void)
{
}

__weak void __SysTick_Handler(void)
{
    irq_enter_rcu();
    __hal_SysTick_Handler();
    irq_exit_rcu();

    if (tif_need_resched())
    {
        __raw_writel(V7M_SCB_ICSR_PENDSVSET, BASEADDR_V7M_SCB + V7M_SCB_ICSR);
    }
}
